package view.user;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.UIManager;

import controller.ActionEvents.ActionHandler;

import javax.swing.JProgressBar;
import javax.swing.plaf.ProgressBarUI;

/**
 * @author Christian
 * Displays the total balance in the bottom of the JFrame.
 */
public class TotalAmount extends JPanel {
	/** Declares swing components as variables*/
	private JLabel lblCurrentBalance;
	private JLabel lblCurrentUser;
	
	private ActionHandler actionHandler; // Object of class ActListener.java
	private JProgressBar progressBar;
	
	/**
	 * Constructor creates the panel and initializes object of ActionHandlers constructor
	 * @param actionHandler
	 */
	public TotalAmount(ActionHandler actionHandler) 
	{
	
	super();
	this.actionHandler = actionHandler;
	
		setPreferredSize(new Dimension(750, 41));
		setLayout(null);
		setBackground(Color.WHITE);
		
		lblCurrentBalance = new JLabel("Current Balance: ");
		lblCurrentBalance.setBounds(468, 0, 235, 20);
		lblCurrentBalance.setFont(new Font("Euphemia UCAS", Font.PLAIN, 14));
		add(lblCurrentBalance);
		
		lblCurrentUser = new JLabel("Logged in as: ");
		lblCurrentUser.setBounds(10, 0, 212, 20);
		lblCurrentUser.setFont(new Font("Euphemia UCAS", Font.PLAIN, 14));
		add(lblCurrentUser);
		
		// Creates an object of JProgressBar, and sets the state with different methods
		progressBar = new JProgressBar();
		progressBar.setBounds(0, 20, 750, 20);
		progressBar.setValue(0);
		progressBar.setMaximum(10000);
		progressBar.setForeground(Color.green);
		progressBar.setString("Level 1"); // Sets the default level to 1
		progressBar.setStringPainted(true);
		
		add(progressBar);
	}
	
	/**
	 * @return the progressBar
	 */
	public JProgressBar getProgressBar() {
		return progressBar;
	}

	/**
	 * @return the lblCurrentBalance
	 */
	public JLabel getLblCurrentBalance() {
		return lblCurrentBalance;
	}

	/**
	 * @return the lblCurrentUser
	 */
	public JLabel getLblCurrentUser() {
		return lblCurrentUser;
	}
} // End TotalAmount.java
